package com.mystudy.leetcode.problem.array.p_832;

import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @program: infoalgorithm
 * @description: 翻转图像
 * @author: zhouzhilong
 * @create: 2019-07-11 10:45
 **/
public class Solution {
    /**
     * logger
     */
    private static final Logger LOGGER = LoggerFactory.getLogger(Solution.class);

    @Test
    public void test() {

    }


    public int[][] flipAndInvertImage(int[][] A) {
        for (int i = 0; i < A.length; i++) {
            int[] tempArray = new int[A.length];
            for (int j = A[i].length - 1; j >= 0; j--) {
                int t = A[i][j];
                t = t == 0 ? 1 : 0;
                tempArray[A.length - j - 1] = t;
            }
            A[i] = tempArray;
        }


        return A;
    }

}
